package com.itheima.homework.异常;

import java.util.Scanner;

public class Demo1 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个数");
        int i = sc.nextInt();
        System.out.println("请输入第二个整数");
        int sum=0;
        try {
            int i1 = sc.nextInt();
            sum=i/i1;
            System.out.println(sum);

        }catch (ArithmeticException e){
            e.printStackTrace();
            System.out.println("第二个数不能为0");
        }


    }
}
